﻿using System.Web.Mvc;
using FlitBit.Dto.ModelBinders;
using FlitBit.Wireup;

namespace FlitBit.Dto.Mvc
{
	/// <summary>
	/// Wires up the DTO-Mvc assembly's dependencies and adds a ModelBinderProvider that will
	/// provide IModelBinders for any abstract type that the current IFactory can resolve, including DTOs.
	/// </summary>
	public sealed class AssemblyWireupAddModelBinderProvider : IWireupCommand
	{
		public void Execute(IWireupCoordinator coordinator)
		{
			ModelBinderProviders.BinderProviders
				.Add(new DtoModelBinderProvider());
		}
	}
}
